{template '_header'}
<div class='fui-page  fui-page-current'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back"></a>
        </div>
        <div class="title">{if empty($address)}新建地址{else}编辑地址{/if}</div>
        <div class="fui-header-right">&nbsp;</div>
    </div>
    <div class='fui-content'>
        <form method='post' class='form-ajax' >
            <input type='hidden' id='addressid' value="{$address['id']}"/>
            <div class='fui-cell-group'>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>收件人</div>
                    <div class='fui-cell-info'><input type="text" id='realname'  name='realname' value="{$address['realname']}" placeholder="收件人" class="fui-input"/></div>
                </div>
                <div class='fui-cell'>
                    <div class='fui-cell-label'>联系电话</div>
                    <div class='fui-cell-info'><input type="tel" id='mobile' name='mobile' value="{$address['mobile']}" placeholder="联系电话"  class="fui-input"/></div>
                </div>



                <div class='fui-cell'>
                    <div class='fui-cell-label'>所在地区</div>
                    <div class='fui-cell-info'><input type="text" id='areas'  name='areas' value="{if !empty($address)}{$address['province']} {$address['city']} {$address['area']}{/if}" placeholder="所在地区"  class="fui-input" readonly=""/></div>
                </div>

                <div class='fui-cell'>
                    <div class='fui-cell-label'>详细地址</div>
                    <div class='fui-cell-info'><input type="text" id='address' name='address' value="{$address['address']}" placeholder='街道，楼牌号等'  class="fui-input"/></div>
                </div>
            </div>


            
            <a id="btn-submit" class='external btn btn-danger block'>保存地址</a>
              {if is_weixin() && $_W['shopset']['trade']['shareaddress']}
                 <a id="btn-address" class='btn btn-success block'>读取微信地址</a>
              {/if}


        </form>
    </div>
    <script language='javascript'>

        require(['biz/member/address'], function (modal) {
            modal.initPost();
        });</script>
</div>

{template '_footer'}